<template>
  <div class="tpl-content-wrapper">
    <ol class="am-breadcrumb">
      <li><a href="#" class="am-icon-home">首页</a></li>
      <li><a href="#">车位系统</a></li>
      <li>
        <router-link :to="{name: 'ProjectView'}">车位管理</router-link>
      </li>
      <li class="am-active">{{isNew ? '新增车位' : form.name}}</li>
    </ol>
    <div class="tpl-portlet-components">
      <button type="button" class="am-btn am-btn-default am-btn-secondary">
        <span class="am-icon-save"></span> {{ id?'修改':'保存' }}
      </button>
      <button type="button" class="am-btn am-btn-default am-btn-secondary">
        {{form.state === '1001'? '复位占用':'复位空闲'}}
      </button>
    </div>
    <div class="am-panel-group" id="collapse-nav">
      <div class="am-panel am-panel-default">
        <div class="am-panel-hd">
          <span class="am-panel-title"><strong>基础数据</strong></span>

          <span class="color-999 am-text-xs am-kai" data-am-collapse="{target: '#do-not-say-1'}"> - 点击展开/折叠</span>
        </div>
        <div id="do-not-say-1" class="am-panel-collapse am-collapse am-in ">
          <div class="am-panel-bd tpl-amazeui-form">
            <!-- form -->
            <form id="form" action="" class="am-g am-form">
              <button id="submit" class="am-btn am-btn-secondary" type="submit" style="display:none;">提交</button>

              <div class="am-u-md-12">
                <div class="am-input-group">
                  <span class="am-input-group-label am-kai">车位名称</span>
                  <input type="text" class="am-form-field" placeholder="请输入车位名称" v-model="form.name" required>
                </div>
              </div>

              <div class="am-u-md-12">
                <div class="am-input-group">
                  <span class="am-input-group-label am-kai">车位地点</span>
                  <input type="text" class="am-form-field" placeholder="请输入车位地点" v-model="form.place" required>
                </div>
              </div>

              <div class="am-u-md-12">
                <div class="am-input-group">
                  <span class="am-input-group-label am-kai">车位编号</span>
                  <input type="text" class="am-form-field" placeholder="请输入车位编号" v-model="form.srcMac" required>
                </div>
              </div>

              <div class="am-u-md-12">
                <div class="am-input-group">
                  <span class="am-input-group-label am-kai">车位状态</span>
                  <select class="am-form-field" v-model="form.state">
                    <option value="1001">空闲中</option>
                    <option value="1002">占用中</option>
                  </select>
                </div>
              </div>
            </form>
            <!-- form end -->
          </div>
        </div>
      </div>
    </div>
    <div class="am-panel am-panel-default">
      <div class="am-panel-hd">
        <span class="am-panel-title"><strong>详细数据</strong></span>

        <span class="color-999 am-text-xs am-kai" data-am-collapse="{target: '#do-not-say-11'}"> - 点击展开/折叠</span>
      </div>
      <div id="do-not-say-11" class="am-panel-collapse am-collapse am-in ">
        <div class="am-panel-bd tpl-amazeui-form">

        </div>
      </div>
    </div>
    <alert :test="alertText"></alert>
    <!-- <select-user @selectUserCheck="selectUserCheck"></select-user> -->
    <auth-msg></auth-msg>
  </div>
</template>

<script>
  import * as apis from '../../../apis'
  // import authCheck from 'assets/authCheck'
  export default {
    // mixins: [authCheck],
    data() {
      return {
        id: this.$route.params.id || '',
        form: {
          name: '', place: '', 
          state: '', srcMac: ''
        },
        user: {},
        form2: { refundType: '1', refundDesc: '' },
        alertText: '',
        confirm: { show: false },
        valid: false, valid2: false, valid3: false, valid4: false,
        isNew: true
      }
    },
    created() {
      if (this.id) {
        this.isNew = false
        this.$router.push({ name: 'projectFormId', params: { id: this.id } })
      }
    },
    mounted() {
    },
    methods: {
    }}
</script>
<style>
  .edui-container {
    width: 100% !important;
  }

  .am-form .am-input-group {
    margin-bottom: 10px;
  }
</style>